package org.zxl.springbootdemo.valid.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.util.Date;

/**
 * @author xiaolong5.zhang
 * @date 2021/12/25 14:51
 **/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class TeacherAddReqDTO {
    @NotNull(message = "教师id不能为空")
    private Integer teacherId;

    @Min(value = 10, message = "长度不能小于10")
    @NotNull(message = "教师名不能为空")
    private String teacherName;

    @Future(message = "时间不能小于当前时间")
    private Date worktime;

    @FutureOrPresent(message = "时间不能大于当前时间")
    private Date beginTime;

    @NotNull(message = "手机号码不能为空")
    @Pattern(regexp = "/^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$/\n", message = "非正确手机号码")
    private String phoneNo;


    @AssertTrue(message = "必须全日制本科学历")
    private Boolean undergraduate;

}
